//
//  QDUnionSignViewController.swift
//  QDMetroClient
//
//  Created by YueWen on 2019/3/10.
//  Copyright © 2019 YueWen. All rights reserved.
//

import UIKit


/// 银联签约渠道
final class QDUnionSignViewController: NWViewController {

    /// 网站
    private let webView = WKWebView()
    /// 传进来的签约信息
    var message = ""
    /// 签约Id
    var orderId = ""
    /// 返回的控制器
    weak var backViewController: UIViewController?
    
    override func viewDidLoad() {
        super.viewDidLoad()

        automaticallyAdjustsScrollViewInsets = false
        
        // Do any additional setup after loading the view.
        navigationItem.leftBarButtonItem = UIBarButtonItem(image: backIndicatorImage.namedImage, landscapeImagePhone: "nav_main_back".namedImage, style: .done, target: self, action: #selector(back))
        navigationItem.title = "银联签约"
        
        view.addSubview(webView)
        webView.snp.makeConstraints { (make) in
            make.left.bottom.right.equalToSuperview()
            make.top.equalToSuperview().offset(BarDistance.NavigationBar.height)
        }
        
        //加载
        webView.loadHTMLString(message, baseURL: nil)
    }
    

    /// 返回
    @objc func back(){
        ritl_topNavigationPush(QDPayTypeStatusViewController(channelId: orderId, payType: .Union, backViewController: backViewController), animated: true)
    }
    
}
